package com.team.vlog_temp.Controller;


import com.team.vlog_temp.Dao.ConsumerDao;
import com.team.vlog_temp.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin // 允许所有来源的跨域请求
public class ConsumerController {
    @Autowired
    private ConsumerDao consumerDao;

    @RequestMapping("/getConsumer")
    public Result<List<Map<String,Object>>> getConsumer(){
        List<Map<String,Object>> list=consumerDao.getPeople();
        return new Result<>("1","成功",list);
    }

//    //编写后台api的接口
//    @RequestMapping("classifyTree")
//    public Result<List<ClassifyDto>> classifyTree(){
//        //调用服务  --->feign
//        List<ClassifyDto> list=classifyService.getClassifyTree();
//        //创建返回结果
//        return new  Result<>("0","成功",list);
//    }



}
